package com.linkage.jz.bankruptcy.bean;

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author AFAP
 * 项目进度节点
 */
public class ProNodeInfo implements Serializable {


    private String id;
    private String bankruptcyProjectId;
    private String modelCode;
    private String nodeName;
    private String nodeNote;
    private String sysAddressId;
    private CommonStatusInfo timeType;
    private long startTime;
    private long endTime;
    private boolean countdown;
    private boolean staging;
    private int sort;
    private MyAddr sysAddressInfo;
    private String opBy;
    private long opAt;
    private boolean delFlag;
    private List<TaskAtta> fileList; // 详情接口这个名称
    private List<TaskAtta> attachmentList; // 列表接口这个名称


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBankruptcyProjectId() {
        return bankruptcyProjectId;
    }

    public void setBankruptcyProjectId(String bankruptcyProjectId) {
        this.bankruptcyProjectId = bankruptcyProjectId;
    }

    public String getModelCode() {
        return modelCode;
    }

    public void setModelCode(String modelCode) {
        this.modelCode = modelCode;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public String getNodeNote() {
        return nodeNote;
    }

    public void setNodeNote(String nodeNote) {
        this.nodeNote = nodeNote;
    }

    public String getSysAddressId() {
        return sysAddressId;
    }

    public void setSysAddressId(String sysAddressId) {
        this.sysAddressId = sysAddressId;
    }

    public CommonStatusInfo getTimeType() {
        return timeType;
    }

    public void setTimeType(CommonStatusInfo timeType) {
        this.timeType = timeType;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public boolean isCountdown() {
        return countdown;
    }

    public void setCountdown(boolean countdown) {
        this.countdown = countdown;
    }

    public boolean isStaging() {
        return staging;
    }

    public void setStaging(boolean staging) {
        this.staging = staging;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public MyAddr getSysAddressInfo() {
        return sysAddressInfo;
    }

    public void setSysAddressInfo(MyAddr sysAddressInfo) {
        this.sysAddressInfo = sysAddressInfo;
    }

    public String getOpBy() {
        return opBy;
    }

    public void setOpBy(String opBy) {
        this.opBy = opBy;
    }

    public long getOpAt() {
        return opAt;
    }

    public void setOpAt(long opAt) {
        this.opAt = opAt;
    }

    public boolean isDelFlag() {
        return delFlag;
    }

    public void setDelFlag(boolean delFlag) {
        this.delFlag = delFlag;
    }

    public List<TaskAtta> getFileList() {
        return fileList;
    }

    public void setFileList(List<TaskAtta> attachmentDownloadAddress) {
        this.fileList = fileList;
    }

    public List<TaskAtta> getAttachmentList() {
        return attachmentList;
    }

    public void setAttachmentList(List<TaskAtta> attachmentList) {
        this.attachmentList = attachmentList;
    }

    public static List<ProNodeInfo> parse(JsonArray arr) {
        List<ProNodeInfo> list = new ArrayList<>();
        for (int i = 0; i < arr.size(); i++) {
            list.add(parse(arr.get(i).getAsJsonObject()));
        }
        return list;
    }

    public static ProNodeInfo parse(JsonObject obj) {
        ProNodeInfo bean = new Gson().fromJson(obj, ProNodeInfo.class);
        return bean;
    }

}
